In Oop's(Object oriented programming) concept, Polymorphism is the characteristic of
being able assign a different to a particular symbol means many shapes.
polymorphism are two types:
Overloading :
Two or more method with different signatures.lets perform a arithmetic
addition of two numbers,the feature in python that allow some operator to have different meaning according to the context is called operator overloading.
Ex: "CUT" are three type of meanings for Surgeon,Hair stylist and Actor.
Pseudo code in java:
void draw(int x1, int y1, int x2, int y2) {
} void draw(float x1, float y1, float x2, float y2) { }
Overriding :
Replacing an inherited method with another having the same signature.
or two or more methods having the same name with same argument in parents class and child class in java.
Pseudo code in java:
class Company {
public void rule() {
System.out.println("company having rules");
}
}
class employee extends company
{
public void rule()
{
System.out.println("amployee must follow rules"); }
public void work() {
System.out.println("employee work for company"); }
}
public class TestEmployee {
public static void main(String args[]) {
Company = new Company();
}
}
Happy Coding :)
Liked By
Write Answer
Overloading and Overriding
Join MindStick Community
You have need login or register for voting of answers or question.
Prakash nidhi Verma
10-Jun-2018Hi Additri,
In Oop's(Object oriented programming) concept, Polymorphism is the characteristic of being able assign a different to a particular symbol means many shapes.
polymorphism are two types:
Overloading :
Two or more method with different signatures.lets perform a arithmetic addition of two numbers,the feature in python that allow some operator to have different meaning according to the context is called operator overloading.
Ex: "CUT" are three type of meanings for Surgeon,Hair stylist and Actor.
Pseudo code in java:
Overriding :
Replacing an inherited method with another having the same signature. or two or more methods having the same name with same argument in parents class and child class in java.
Pseudo code in java:
Happy Coding :)